﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MagicOnion;
using MagicOnion.Server;
using RPCTestShared;

namespace RPCWebCoreService
{

    // implement RPC service to Server Project.
    // inehrit ServiceBase<interface>, interface
    public class MyFirstService : ServiceBase<IMyFirstService>, IMyFirstService
    {
        public async UnaryResult<ProjectData> CreateProjectData(ProjectPoint point)
        {
            var data = new ProjectData();
            data.ModifyTime = DateTime.Now;
            data.Title = point.ProjectName;

            return data;
        }

        // You can use async syntax directly.
        public async UnaryResult<int> SumAsync(int x, int y)
        {
            //Logger.Debug($"Received:{x}, {y}");

            return x + y;
        }


    }
}
